package com.zhuangjie.shop.feign;

import com.zhaungjie.base.conduit.TypeR;
import com.zhuangjie.base.constant.ModuleSecurityNames;
import com.zhuangjie.coupon.pojo.CouponCoreInfo;
import com.zhuangjie.coupon.vo.ApplicableShopCouponCoreInfoVO;
import com.zhuangjie.security.annotations.PublicAPI;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

@Component
@FeignClient(name= "spark-coupon",path = "/coupon")
public interface CouponFeignService {
    @ApiOperation("查询token所有者已领取与可领取（仅店铺券）的券")
    @GetMapping("/coupon/applicable-shop-coupon/{shopId}")
    TypeR<List<CouponCoreInfo>> queryApplicableShopCoupon(@PathVariable("shopId") Long shopId);

    @ApiOperation("查询token所有者已领取的平台券")
    @GetMapping("/coupon/received-platform-coupon")
    TypeR<List<CouponCoreInfo>> queryReceivedPlatformCoupon(@RequestParam("isParticipatingInPlatformInflationCouponActivity") Boolean isParticipatingInPlatformInflationCouponActivity);


    @ApiOperation("查询当前用户店铺券（已领取与可领取）与已拥有的平台券-core信息")
    @GetMapping("/coupon/applicable-shop-coupon-core-info")
    @PublicAPI(modules = {ModuleSecurityNames.USER})
    TypeR<ApplicableShopCouponCoreInfoVO> queryApplicableShopCouponCoreInfo(@NotNull(message = "店铺id不能为空") @RequestParam("shopId") Long shopId,
                                                                            @RequestParam("isParticipatingInPlatformInflationCouponActivity") Boolean isParticipatingInPlatformInflationCouponActivity);

}
